package org.springblade.feign;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Feign接口类
 * @author Chill
 */
@FeignClient(
	value = "blade-device-connect"
)
public interface IDeviceConnectClient {

	String API_PREFIX = "/device-connect";
	String RECONNECTION = API_PREFIX + "/reconnection";
	String SENDCODE = API_PREFIX + "/sendCode";


	/**
	 * 指令发送
	 * @param ipAddr
	 * @param port
	 * @param protocol
	 * @param protocolAnalysisS
	 */
	@PostMapping(SENDCODE)
	void sendCode(@RequestParam("ipAddr") String ipAddr,
				  @RequestParam("port") Integer port,
				  @RequestParam("protocol") Integer protocol,
				  @RequestParam("protocolAnalysisS") String protocolAnalysisS);


	/**
	 * 重新连接
	 * @param ipAddr
	 * @param port
	 * @param protocol
	 */
	@GetMapping(RECONNECTION)
	void reconnection(@RequestParam("ipAddr") String ipAddr,
					  @RequestParam("port") Integer port,
					  @RequestParam("protocol") Integer protocol);
}
